package actionPattern.modelMethod;

public abstract class AbstractDress {

    private boolean isHat;

    protected abstract void wearHat();

    protected abstract void wearShirt();

    protected abstract void wearJeans();

    protected abstract void wearShoes();

    protected void setIsdHat(boolean isHat) {
        this.isHat = isHat;
    }

    public final void dress() {
        System.out.println("开始穿衣服");
        if(!isHat) {
            System.out.println("不想戴帽子");
        } else {
            wearHat();
        }
        wearShirt();
        wearJeans();
        wearShoes();
        System.out.println("穿衣完毕");
    }
}
